﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CelsiusToFahrenheit
	{
	class Program
		{
		static void Main(string[] args)
			{
			/*Pseudo code for this program
			 * print: "Celsius to Fahrenheit Temperature Converter"
			 * print: "Please provide the Celsius value to convert to Fahrenheit"
			 * input: Celsius to be converted into Fahrenheit
			 * process: Fahrenheit = 9/5 * Celsius + 32
			 * print: Fahrenheit
			 */
			int Cels = 0;
			Start:
			print("Celsius to Fahrenheit Temperature Converter");
			print("Please provide the Celsius value to convert to Fahrenheit");
			getCelsius(ref Cels);
			double Fahr = 1.8 * (double)Cels + 32;
			Console.WriteLine("\n{0} in Fahrenheit is a total of {1}", Cels, Fahr);
			goto Start; //infinite loop to keep writing different numbers as the Celsius value
			}
		static void getCelsius(ref int Cels)
			{
			while (!int.TryParse(Console.ReadLine(), out Cels))
				print("You have provided an invalid Value, please provide a value with no decimals.");
			}
		static void print(string p)
			{
			Console.WriteLine("\n{0}", p);
			}
		}
	}
